usually with Number_format (); To format a number, by default the thousand characters are separated by commas, such as:
Copy the Code code as follows:
Echo Number_format ("10000.01231", 2);Take 2 digits after the decimal point, the result of the
usually with Number_format (); To format a number, by default the thousand characters are separated by commas, such as:
Copy CodeThe code is as follows:
Echo Number_format ("10000.01231", 2);
Take 2 digits after the decimal point, the result of the
usually with Number_format (); To format numbers, the default thousand are separated by commas, such as:
Copy Code code as follows:
Echo Number_format ("10000.01231", 2);
2 digits after the decimal point, the output result is: 10,000.1000
Do mobile phone page We often encounter numbers, and in the Safari browser these numbers will display the phone number by default, so we use the method of pit to add tags:The meaning of this tag is that the number is not treated as a phone number,
The following is a detailed analysis of the implementation code of the numberformat () function in php that uses a thousand-bit grouping to format numbers. For more information, see
Definition and usageThe number_format () function uses a
Original articles, reproduced please specify: http://blog.csdn.net/chang_yuan_2011/article/details/46836045The thousand separator is the number, every three digits into a comma, the idea is to determine whether there are more than four connected
A. Serial NumberOrdinal sequence number, sequential numbers, such as numbers: 1, 2, 3 ..., uppercase Chinese characters are also counted as numbers, such as: one, two or three ... The serial number can distinguish the same kind of thing clearly,
Php processing method with a comma-separated digit. For more information, see.
Php processing method with a comma-separated digit. For more information, see.
Generally, number_format (); is used to format numbers. By default, the Delimiter
Use the Number_format () function in PHP to format numbers using thousands of groupings.
Number_format (Number,decimals,decimalpoint,separator)
Number required. The number to format. If no other parameters are set, the number is formatted with no
The so-called digital thousand-digit form, that is, from single-digit digits, with a comma between each three digits. For example, "10,000". In response to this requirement, I initially wrote a function like this:
Copy Code code as follows:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.